package com.cssy.xxkj.logic.dao.impl;

import com.cssy.xxkj.logic.dao.LogicPayReturnItemDAO;
import com.cssy.xxkj.logic.entity.LogicPayItemDO;
import com.cssy.xxkj.logic.entity.LogicPayReturnItemDO;
import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

/**
 * 数据访问对象实现类
 * @since 2014-10-11
 */
public class LogicPayReturnItemDAOImpl extends SqlMapClientDaoSupport implements LogicPayReturnItemDAO {

    /**
     * 插入数据
     * @param logicPayReturnItemDO
     * @return 插入数据的主键
     */
    public String insertLogicPayReturnItemDO(LogicPayReturnItemDO logicPayReturnItemDO) {
        Object id = getSqlMapClientTemplate().insert("LogicPayReturnItem.insert", logicPayReturnItemDO);
        return (String) id;
    }

    /**
     * 统计记录数
     * @param logicPayReturnItemDO
     * @return 查出的记录数
     */
    public Integer countLogicPayReturnItemDOByExample(LogicPayReturnItemDO logicPayReturnItemDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicPayReturnItem.countByDOExample", logicPayReturnItemDO);
        return count;
    }

    /**
     * 更新记录
     * @param logicPayReturnItemDO
     * @return 受影响的行数
     */
    public Integer updateLogicPayReturnItemDO(LogicPayReturnItemDO logicPayReturnItemDO) {
        int result = getSqlMapClientTemplate().update("LogicPayReturnItem.update", logicPayReturnItemDO);
        return result;
    }

    /**
     * 获取对象列表
     * @param logicPayReturnItemDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<LogicPayReturnItemDO> findListByExample(LogicPayReturnItemDO logicPayReturnItemDO) {
        List<LogicPayReturnItemDO> list = getSqlMapClientTemplate().queryForList("LogicPayReturnItem.findListByDO", logicPayReturnItemDO);
        return list;
    }

    /**
     * 根据主键获取logicPayReturnItemDO
     * @param id
     * @return logicPayReturnItemDO
     */
    public LogicPayReturnItemDO findLogicPayReturnItemDOByPrimaryKey(String id) {
        LogicPayReturnItemDO logicPayReturnItemDO = (LogicPayReturnItemDO) getSqlMapClientTemplate().queryForObject("LogicPayReturnItem.findByPrimaryKey", id);
        return logicPayReturnItemDO;
    }

    /**
     * 删除记录
     * @param id
     * @return 受影响的行数
     */
    public Integer deleteLogicPayReturnItemDOByPrimaryKey(String id) {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicPayReturnItem.deleteByPrimaryKey", id);
        return rows;
    }

	@Override
	public List<LogicPayReturnItemDO> findListByMap(Map<String, Object> paramMap) {
		List<LogicPayReturnItemDO> list=getSqlMapClientTemplate().queryForList("LogicPayReturnItem_ex.findListByMap",paramMap);
		return list;
	}

}